#!/bin/bash

# Deploy to Gitee script
# This script provides instructions for deploying the code to Gitee

echo "To deploy the code to Gitee, you have two options:"

echo ""
echo "Option 1: Using HTTPS with Personal Access Token (PAT)"
echo "1. Generate a Personal Access Token on Gitee:"
echo "   - Go to https://gitee.com/profile/personal_access_tokens"
echo "   - Click 'Generate New Token'"
echo "   - Select scopes: repo, push"
echo "   - Click 'Generate Token'"
echo "   - Copy the generated token"
echo ""
echo "2. Set the token as an environment variable (replace YOUR_TOKEN with your actual token):"
echo "   export GITEE_TOKEN=YOUR_TOKEN"
echo ""
echo "3. Run the following command to push:"
echo "   git push -u origin master"
echo ""
echo "If you get a username/password prompt, use your Gitee username and the token as the password."

echo ""
echo "Option 2: Using SSH"
echo "1. Generate an SSH key pair (if you don't have one):"
echo "   ssh-keygen -t rsa -b 4096 -C \"your_email@example.com\""
echo ""
echo "2. Add the SSH key to your Gitee account:"
echo "   - Copy the public key: cat ~/.ssh/id_rsa.pub"
echo "   - Go to https://gitee.com/profile/sshkeys"
echo "   - Click 'Add SSH Key'"
echo "   - Paste the public key and save"
echo ""
echo "3. Change the remote URL to SSH:"
echo "   git remote set-url origin git@gitee.com:hansonjack/3dwms.git"
echo ""
echo "4. Push using SSH:"
echo "   git push -u origin master"

echo ""
echo "For first-time Git setup, you might also want to configure your user information:"
echo "git config --global user.name \"Your Name\""
echo "git config --global user.email \"your.email@example.com\""